/*
 * Copyright (c) 2022 上海市政工程设计研究总院(集团)有限公司 All Rights Reserved.
 */
package com.smedi.ismedi.personnel.core.port.adapter.convert;

import com.smedi.ismedi.authoritymanagement.api.dto.request.RoleAssignmentListQueryRequest;
import com.smedi.ismedi.authoritymanagement.api.dto.request.RoleListQueryRequest;
import com.smedi.ismedi.authoritymanagement.api.dto.response.RoleAssignmentResponse;
import com.smedi.ismedi.authoritymanagement.api.dto.response.RoleResponse;
import com.smedi.ismedi.constructionproject.api.dto.request.ProjectAssignmentListQueryRequest;
import com.smedi.ismedi.constructionproject.api.dto.response.resp.ProjectAssignmentResp;
import com.smedi.ismedi.organization.api.dto.request.OrganizationListQueryRequest;
import com.smedi.ismedi.organization.api.dto.request.OrganizationOneQueryRequest;
import com.smedi.ismedi.organization.api.dto.response.resp.OrganizationResp;
import com.smedi.ismedi.personnel.api.dto.request.OrganizationAssignmentListQueryRequest;
import com.smedi.ismedi.personnel.api.dto.request.PersonEditRequest;
import com.smedi.ismedi.personnel.api.dto.request.PersonListQueryRequest;
import com.smedi.ismedi.personnel.api.dto.response.resp.OrganizationAssignmentResp;
import com.smedi.ismedi.personnel.api.dto.response.resp.PersonDetailResp;
import com.smedi.ismedi.personnel.api.dto.response.resp.PersonResp;
import com.smedi.ismedi.personnel.core.application.command.OrganizationAssignmentListQueryCommand;
import com.smedi.ismedi.personnel.core.application.command.PersonEditCommand;
import com.smedi.ismedi.personnel.core.application.command.PersonListQueryCommand;
import com.smedi.ismedi.personnel.core.application.query.vo.PersonDetailVo;
import com.smedi.ismedi.personnel.core.application.query.vo.ProjectAssignmentVo;
import com.smedi.ismedi.personnel.core.domain.aggregatemodel.Role;
import com.smedi.ismedi.personnel.core.domain.aggregatemodel.RoleAssignment;
import com.smedi.ismedi.personnel.core.domain.aggregatemodel.model.Organization;
import com.smedi.ismedi.personnel.core.domain.aggregatemodel.model.OrganizationAssignment;
import com.smedi.ismedi.personnel.core.domain.aggregatemodel.model.SimplePerson;
import com.smedi.ismedi.personnel.core.domain.dto.RoleAssignmentQuery;
import com.smedi.ismedi.personnel.core.domain.dto.RoleQuery;
import com.smedi.ismedi.personnel.core.port.adapter.persistence.dto.OrganizationQuery;
import com.smedi.ismedi.personnel.core.port.adapter.persistence.dto.ProjectAssignmentQuery;
import com.smedi.ismedi.personnel.core.port.adapter.persistence.model.AssignmentEntity;
import com.smedi.ismedi.personnel.core.port.adapter.persistence.model.PersonEntity;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;

import java.util.List;

/**
 * 维修内容 Infrastructure Converter
 *
 * @author 15428
 * &#064;date  2022-06-07 15:22:03
 * @since 0.0.1
 */
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface AdapterConverter {

    PersonListQueryCommand personListQueryRequestToPersonListQueryCommand(PersonListQueryRequest personListQueryRequest);

    List<PersonResp> peopleToPersonResp(List<SimplePerson> people);

    List<PersonDetailResp> personDetailVoToPersonDetailResp(List<PersonDetailVo> personDetailVos);

    SimplePerson personEntityToPeople(PersonEntity personEntity);

    List<SimplePerson> personEntityToPeople(List<PersonEntity> personEntities);

    OrganizationListQueryRequest organizationQueryToOrganizationListQueryRequest(OrganizationQuery organizationQuery);

    Organization organizationRespToOrganization(OrganizationResp organizationResp);

    List<Organization> organizationRespToOrganization(List<OrganizationResp> organizationResps);

    OrganizationAssignment assignmentEntityToOrganizationAssignment(AssignmentEntity assignmentEntity);

    OrganizationAssignmentListQueryCommand organizationAssignmentListQueryRequestToOrganizationListQueryCommand(OrganizationAssignmentListQueryRequest organizationAssignmentListQueryRequest);

    List<OrganizationAssignment> assignmentEntityToOrganizationAssignment(List<AssignmentEntity> assignmentEntities);

    List<OrganizationAssignmentResp> organizationAssignmentToOrganizationAssignmentResp(List<OrganizationAssignment> organizationAssignments);

    //PersonEntity

    RoleListQueryRequest roleQueryToRoleListQueryRequest(RoleQuery roleQuery);

    List<Role> roleResponseToRole(List<RoleResponse> roleResponses);

    Role roleResponseToRole(RoleResponse roleResponse);

    RoleAssignmentListQueryRequest roleAssignmentQueryToRoleAssignmentListQueryRequest(RoleAssignmentQuery roleAssignmentQuery);

    List<RoleAssignment> roleAssignmentResponseToRoleAssignment(List<RoleAssignmentResponse> roleAssignmentResponses);

    OrganizationOneQueryRequest organizationQueryToOrganizationOneQueryRequest(OrganizationQuery organizationQuery);

    ProjectAssignmentListQueryRequest projectAssignmentQueryToProjectAssignmentListQueryRequest(ProjectAssignmentQuery projectAssignmentQuery);

    PersonEditCommand personEditRequestToPersonEditCommand(PersonEditRequest personEditRequest);

    SimplePerson personEditCommandToSimplePerson(PersonEditCommand personEditCommand);

    PersonEntity simplePersonToPersonEntity(SimplePerson simplePerson);

    ProjectAssignmentVo projectAssignmentRespToProjectAssignmentVo(ProjectAssignmentResp projectAssignmentResp);

    List<ProjectAssignmentVo> projectAssignmentRespToProjectAssignmentVo(List<ProjectAssignmentResp> projectAssignmentResps);

    PersonDetailVo simplePersonToPersonDetailVo(SimplePerson simplePerson);

    List<PersonDetailVo> simplePersonToPersonDetailVo(List<SimplePerson> simplePerson);
}
